<template>
	<tm-app color="#efefef">		
			<view class="flex flex-between pl-30 FormM1">
				<navbar-module title="已入栏工单" :transprent="true"/>
			</view> 
			<tm-sheet :padding="[2,2]" style="margin-top:-100rpx">
				<tm-cell bottomBorder :margin="[0,0]" title="工单编号" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.code}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="猪仔名称" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.pig.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="猪仔品种" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.pig.pigLevel.breed.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell v-if="isManage" bottomBorder :margin="[0,0]" title="负责人" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.staff.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="猪圈" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.content.pigsty?.name}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="猪圈类型" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.pig.pigLevel?.kind?.label}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="耳标编号" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.content.rfid}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="入栏日龄" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.content.day}}</tm-text>
					</template>
				</tm-cell>
				<tm-cell bottomBorder :margin="[0,0]" title="入栏时间" :titleFontSize="32">
					<template v-slot:right>
						<tm-text :fontSize="32">{{FormData.data.completeTime}}</tm-text>
					</template>
				</tm-cell>
			</tm-sheet>
	</tm-app>
</template>

<script setup lang='ts'>
import { reactive } from "vue";
import {onLoad} from '@dcloudio/uni-app'

    const FormData = reactive({data:{}})
	const isManage = uni.getStorageSync('isManage')

    onLoad((option)=>{
		FormData.data = JSON.parse(decodeURIComponent(option.data))
	})

	
</script>

<style>

</style>
